<?php

class Tag{
	public $tag =[
		'stu'=>['block'=>1],
		'news'=>['block'=>1],
		'foreach'=>['block'=>1],
		'hd'=>['block'=>1],
		'jquery'=>['block'=>0],
		'css'=>['block'=>0]
	];
	public function _css($attr)
	{
		return '<link rel="stylesheet" href="'.$attr['file'].'" type="text/css"/>';
	}

	public function _jquery($attr,$content)
	{
		
		return '<script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>';
	}

	//[row='2']
	public function _stu($attr,$content)
	{
		$where = isset($attr['where'])?" WHERE {$attr['where']}":'';
$str=<<<php
	<?php
	require_once 'db.php';
	\$sql = "select * from stu $where limit {$attr['row']} ";
	\$obj =new Db;
	\$result = \$obj->query(\$sql);
	foreach(\$result as \$field):?>
	$content;
	<?php endforeach;?>
php;
		return $str;

	}

	public function _news()
	{

	}

	public function _hd($attr,$content)
	{
		return 333;
	}
}